package com.liucxu.qiushimeinv.Utils;

import android.telephony.TelephonyManager;
import android.text.TextUtils;

import com.liucxu.qiushimeinv.App.App;

import java.util.UUID;

import static android.content.Context.TELEPHONY_SERVICE;

/**
 * 设备信息工具类
 * Created by liukanshan on 2017/1/5.
 */

public class DeviceUtils {

    public static String GetDevcieId() {
        TelephonyManager TelephonyMgr = (TelephonyManager) App.GetInstance().getSystemService(TELEPHONY_SERVICE);
        String szImei = TelephonyMgr.getDeviceId();
        if (TextUtils.isEmpty(szImei)) {
            UUID uuid = UUID.randomUUID();
            szImei = uuid.toString();
        }
        return szImei;
    }
}
